﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows;
using System.Windows.Controls;

namespace UIKit
{
    /// <summary>
    /// A Window will be a UserControl that has UIKit Content inside it?
    /// </summary>
    public class UIWindow : UIView
    {
        #region properties
        bool keyWindow;
        UIWindowLevel windowLevel;
        #endregion

        #region methods

        public void becomeKeyWindow() {
            throw new NotImplementedException();
        }

        public void makeKeyWindow()
        {
            throw new NotImplementedException();
        }
        public void resignKeyWindow()
        {
            throw new NotImplementedException();
        }
        public void sendEvent(UIEvent e)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// This is kind of pointless as we are hosting multiple UIWindows
        /// within a WPF or silverlight window.
        /// </summary>
        public void makeKeyAndVisible()
        {
            this.hidden = false;
        }


        #region coordinate conversion
        /// <summary>
        /// (C# 4.0)
        /// </summary>
        /// <param name="point"></param>
        /// <param name="window"></param>
        /// <returns></returns>
        Point convertPointFromWindow(Point point, UIWindow window)
        {
            return new Point(0, 0);
        }

        /// <summary>
        /// (C# 4.0)
        /// </summary>
        /// <param name="point"></param>
        /// <param name="window"></param>
        /// <returns></returns>
        Point convertPointToWindow(Point point, UIWindow window)
        {
            return new Point(0, 0);
        }

        /// <summary>
        /// (C# 4.0)
        /// </summary>
        /// <param name="point"></param>
        /// <param name="window"></param>
        /// <returns></returns>
        Rect convertRectFromWindow(Point rect, UIWindow window)
        {
            return new Rect(0, 0, 0, 0);
        }

        /// <summary>
        /// (C# 4.0)
        /// </summary>
        /// <param name="point"></param>
        /// <param name="window"></param>
        /// <returns></returns>
        Rect convertRectToWindow(Rect rect, UIWindow window)
        {
            return new Rect(0, 0, 0, 0);
        }

        #endregion

        #endregion

        #region constants
        const string UIKeyboardCenterBeginUserInfoKey = @"UIKeyboardCenterBeginUserInfoKey";
        const string UIKeyboardCenterEndUserInfoKey = @"UIKeyboardCenterEndUserInfoKey";
        const string UIKeyboardBoundsUserInfoKey = @"UIKeyboardBoundsUserInfoKey";
        const string UIKeyboardAnimationDurationUserInfoKey = @"UIKeyboardAnimationDurationUserInfoKey";
        const string UIKeyboardAnimationCurveUserInfoKey = @"UIKeyboardAnimationCurveUserInfoKey";
        #endregion


        #region non-UIKit code

        /// <summary>
        /// Quick and dirty factory method to create a window from an existing
        /// User Control (ContentControl is UserControl's base class)
        /// </summary>
        /// <param name="ctrl"></param>
        /// <returns></returns>
        public static UIWindow createWindow(UserControl ctrl) {
            UIWindow win = new UIWindow();
            win.viewElement = ctrl;
            return win;
        }

        #endregion
    }
}
